import React, {Component} from 'react';
import {
  View,
  Text,
  TouchableOpacity,
  StyleSheet,
  Platform,
  Picker,
  Image,
} from 'react-native';

import Config from '../../config';
import Colors from '../../common/Colors';
import CommonStyles from '../../common/CommonStyles';
import SizeUtils from '../../common/SizeUtils';
import TImage from '../../components/TImage';
import CommonListPage from '../common/CommonListPage';
import {DateUtils} from '../../utils/Utils';
import QuanziPostListItemView from "./QuanziPostListItemView";
import QZ_FollowToPosts from '../../actions/quanzi/QZ_FollowToPosts';
import QZ_FollowPostsListAction from '../../actions/quanzi/QZ_FollowPostsListAction';

export default class QZ_GuanZhuDataPage extends CommonListPage {
	constructor(props) {
      super(props);
	}
	_getViewStyle() {
      return {paddingTop:0,
        backgroundColor:"#ffffff"}
  	}
	_getListViewStyle() {
      return {
        width:SizeUtils.getWindowSize().width,
        paddingTop:0,
        height:(SizeUtils.getWindowSize().height - Config.paddingTop-SizeUtils.translateDesignHeightToCode(0)),
        backgroundColor:"#ff0"};
  	}
    _refRefresh(){
    this.doRefresh();
  }
    _onRenderItem(data, index) {
      
      return (<QuanziPostListItemView
              user_id={this.props.pageData.routeData.userData.user_id}
              data={data.post}
              refRefresh={this._refRefresh.bind(this)}
          is_follow={data.is_follow}
          boardName={data.boardName}
          key={index}
        />)
    }
  	_requestData(page, listView) {
  		if (this.props.type==='tiezi') {
  			new QZ_FollowToPosts().call(listView, {page:page,page_size:10})
  		}else if (true) {
        new QZ_FollowPostsListAction().call(listView, {page:page,page_size:10}) 
      } 
  	}
}